package com.cheetah.start.module.system.async;

import com.cheetah.start.module.system.domain.SysFile;
import com.cheetah.start.module.system.service.ISysFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author Feel
 * @date 2021/7/13 10:53
 */
@Slf4j
@Service
public class FileAsyncService {
    @Autowired
    private ISysFileService sysFileService;

    @Async
    public void record(SysFile sysFile) {
        boolean save = sysFileService.save(sysFile);
        if (!save) {
            log.error("文件信息插入失败");
        }
    }
}
